package com.xiyang.demo.controller;

import com.xiyang.demo.service.LoginService;
import com.xiyang.demo.service.impl.RedissonDistributedLocker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import sun.util.calendar.BaseCalendar;
import java.util.Calendar;
import java.util.Date;

@RequestMapping
@RestController
public class loginController {

    @Autowired
   private LoginService loginService;
    @Autowired
    private RedissonDistributedLocker redissonClient;

    @PostMapping("/login")
    public String login(@RequestParam("name")String name, @RequestParam("password")Integer password){


        return  loginService.login(name,password);
    }

    @PostMapping("/addlock")
    public String addlock(@RequestParam("id")Long id){

        return  "666666";
    }

//    public static void main(String[] args) {
//        Integer i1= 127;
//        Integer i2= 128;
//        Integer i3 = new Integer(127);
//        Integer i4 = new Integer(128);
//        int i5 = 127;
//        int i6 = 128;
//        System.out.println( i2.compareTo(127));
//        System.out.println( i2.compare(127));
//
//    }


}

